
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

package com.hlkj.pay.common;

import com.hlkj.framework.common.exception.IErrorCode;
import com.hlkj.pay.common.constants.ResultCodeConstant;

/**
 * @author lyc
 */

public enum CommonResultCode implements IErrorCode {
    // ================common=============
    PARAMETER_MISSING( 400, "参数缺失"),
    PARAMETER_ERROR( 400, "参数格式"),
    SERVICE_ERROR(500, "服务器异常"),
    
    TOKEN_PARAMETER_MISSING(ResultCodeConstant.COMMON_PREFIX+1, "令牌参数错误"),
    TOKEN_PARAMETER_ERROR(ResultCodeConstant.COMMON_PREFIX+2, "令牌参数无效"),
    TOKEN_PARAMETER_EXPIRE( ResultCodeConstant.COMMON_PREFIX+3, "令牌已失效"),
    
    TOKEN_USER_PWD_NUM_ERROR(ResultCodeConstant.COMMON_PREFIX+4, "登录失败次数过多"),
    TOKEN_AUTH_CODE_NUM_REQUEST(ResultCodeConstant.COMMON_PREFIX+5, "token 获取次数过多"),
    
    AUTH_CODE_ERROR(ResultCodeConstant.COMMON_PREFIX+6, "验证码错误"),
    DATA_NOT_EXIST(ResultCodeConstant.COMMON_PREFIX+7, "数据不存在"),
    DATA_HAS_EXIST(ResultCodeConstant.COMMON_PREFIX+7, "数据已存在"),
    APP_NOT_EXIST( ResultCodeConstant.COMMON_PREFIX+8, "app 不存在 请检查 redirect"),
    DATA_ENCRYPT_ERROR(ResultCodeConstant.COMMON_PREFIX+9, "数据加密异常"),
    DATA_DECRYPT_ERROR(ResultCodeConstant.COMMON_PREFIX+10, "数据解密异常"),
    SYSTEM_DOING(ResultCodeConstant.COMMON_PREFIX+11, "系统处理中,请稍后再试"),
    DATA_NOT_EFFECT(ResultCodeConstant.COMMON_PREFIX+12, "数据无效"),

    OCR_INIT_ERROR(ResultCodeConstant.COMMON_PREFIX+101, "ocr初始化失败,请稍后再试"),
    OCR_ERROR(ResultCodeConstant.COMMON_PREFIX+102, "ocr识别失败,请稍后再试"),
    
    FILE_NOT_EXIST(ResultCodeConstant.COMMON_PREFIX+201, "请选择对应的文件"),
    FILE_UPLOAD_ERROR(ResultCodeConstant.COMMON_PREFIX+202, "文件上传失败,请稍后再试"),
    FILE_ERROR( ResultCodeConstant.COMMON_PREFIX+203, "文件格式错误"),
    TEMPLATE_NAME_ALREADY_EXISTS(ResultCodeConstant.COMMON_PREFIX+301,"模板名称已存在"),
    TEMPLATE_DOES_NOT_EXIST(ResultCodeConstant.COMMON_PREFIX+302,"消息模板不存在"),
    MESSAGE_RECEIVER_DOES_NOT_EXIST(ResultCodeConstant.COMMON_PREFIX+303,"消息接受者为空"),
    
    COMMON_APP_EXISTS(ResultCodeConstant.COMMON_PREFIX+401,"微信 支付宝 配置存在"),
    COMMON_APP_NOT_EXIST(ResultCodeConstant.COMMON_PREFIX+402,"微信 支付宝 配置不存在"),
    NOTICE_NOT_EXIST(ResultCodeConstant.COMMON_PREFIX+501,"公告不存在"),
    EXTENSION_NOT_EXIST(ResultCodeConstant.COMMON_PREFIX+601,"当前路由点不存在,请等待后续实现"),


    ORDER_MONTH_STATISTICS_ERROR(ResultCodeConstant.COMMON_PREFIX+1000,"查询月份超过可查范围"),
    ORDER_DAY_STATISTICS_ERROR(ResultCodeConstant.COMMON_PREFIX+1001,"只能查询%s天内的订单信息"),
    ORDER_STATISTICS_TIME_NOT_EMPTY(ResultCodeConstant.COMMON_PREFIX+1002,"查询日期不能为空"),
    ORDER_STATISTICS_TIME_EXCEPTION(ResultCodeConstant.COMMON_PREFIX+1003,"查询日期格式错误"),
    ;

    /**
     * 错误码
     */
    private final Integer code;
    /**
     * 错误提示
     */
    private final String msg;

    CommonResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

}
